# import serializers
from rest_framework import routers, serializers, viewsets
from data_api.models import HotelRedGround, HotelIdBind, HotelWhitePrice, HotelItemPrice, HotelItemXx, HotelXcId


class HotelRedGroundSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelRedGround
        # 和"__all__"等价
        fields = ('hotel_id', 'name', 'path', 'city_code', 'other')


class HotelIdBindSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelIdBind
        # 和"__all__"等价
        fields = "__all__"


class HotelWhitePriceSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelWhitePrice
        # 和"__all__"等价
        fields = "__all__"


class HotelItemPriceSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelItemPrice
        # 和"__all__"等价
        fields = "__all__"


class HotelItemXxSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelItemXx
        # 和"__all__"等价
        fields = "__all__"


class HotelXcIdSerializer(serializers.ModelSerializer):
    # ModelSerializer和Django中ModelForm功能相似
    # Serializer和Django中Form功能相似
    class Meta:
        model = HotelXcId
        # 和"__all__"等价
        # fields = ('hotel_id',)
        fields = "__all__"
